package javabasic.forth;

import java.time.LocalDate;
import java.util.Objects;

/**
 * @author Jonny Long
 * @date 2021/2/18 10:30
 */
public class Employee implements Cloneable{
    private String name;
    private double salary;

    static {
        System.out.println("HelloWorld");
    }
    public static void swap(Employee x,Employee y){
        Employee temp=x;
        x=y;
        y=temp;
        System.out.println("x = "+x);
        System.out.println("y = "+y);
    }

    public void show(){
        System.out.println("Employee--show");
    }

    @Override
    public Employee clone(){
        try {
            Employee clone = (Employee) super.clone();
            return clone;
        }catch (CloneNotSupportedException e){
            e.printStackTrace();
            return null;
        }
    }

    @Override
    public String toString() {
        return "Employee{" +
                "name='" + name + '\'' +
                ", salary=" + salary +
                '}';
    }

    public Employee() {
    }

    public Employee(String name, double salary) {
        this.name = name;
        this.salary = salary;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }
}
